<!--
 * @author: lhy
-->

<script setup>
import {onMounted, ref} from "vue";
import useCinemaStore from "../store/cinemasStore.js";
const selectType = ref(1)
const  store = useCinemaStore()
onMounted(()=>{
  if (store.cinemaList.length === 0){
    store.getCinemaList()
  }else {
    console.log("缓存")
  }
})
</script>
<template>
  <div>
    <select v-model="selectType">
      <option :value="1">app订票</option>
      <option :value="0">前台兑换</option>
    </select>
    <ul>
      <li v-for="item in store.filterCinemaList(selectType)" :key="item.cinemaId">
        {{item.name}}
      </li>
    </ul>
  </div>
</template>

<style lang="scss">
ul{
  li{
    padding: 10px;
  }
}
</style>